package mystia.lorelei.app.repository;

import mystia.lorelei.app.entity.Activity;
import org.checkerframework.checker.units.qual.A;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface ActivityRepository extends JpaRepository<Activity,Integer> {
	@Query(value = "select * from activity where cuisine_id = ?1 and require_grade <= ?2 order by require_grade desc limit 1",nativeQuery = true)
	public Activity findCorrespondActivity(int cuisineId,int requireGrade);
	
	@Query(value = "delete from activity a where a.id in ?1",nativeQuery = true)
	public void deleteAllByIds(List<Integer> ids);
}
